<?php 
require 'func.php';
$getStudent = getStudent();
////////////////////////////////////////////////////////////////////////////////////////
//																				FEEDBACK 
////////////////////////////////////////////////////////////////////////////////////////
$resultsFeedback= "You have not attempted this test";
if ($_SESSION['score'] <= 5) {
     $resultsFeedback = "You have less than 5, you should...";
}
if ($_SESSION['score'] > 6 && $_SESSION['score'] < 9){
    $resultsFeedback = "You have between 5 and 8, you should...";
}
if ($_SESSION['score'] >8){
       $resultsFeedback = "You have more than 9, you should...";
}
if (!$_SESSION['score']){
       $resultsFeedback = "You have not attempted this test...";
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="styles/styles.css" type="text/css" />
<title>Results</title>
</head>
<body>
<header> Formative Assessment 
</header>
<nav>
<?php include 'nav.php' ?>
</nav>
 <div id="container" class="one-edge-shadow">
<div id="mainContent">
 <h1>Feedback</h1>
      <h2>You scored
        <?php echo $_SESSION['score']?>
        /10</h2>
      <progress id="finalProgress" max="10" value="<?php echo $_SESSION['score']?>"><?php echo $_SESSION['score']?></progress>
      <p>
        <?php echo $resultsFeedback ?>
      </p>
      <?php
$getTestFeedback = getTestFeedback($_SESSION['studentID'], $testID, $attempt)

?>
    
      <p class='smiling'>Incorrect Answers:
        <?php echo print_r(array_values($_SESSION['incorrect']))?>
      </p>
      <p class='smiling'>Correct Answers:
        <?php echo print_r(array_values($_SESSION['rightAnswers']))?>
      </p>
      <p class='smiling'>Selected Answers:
        <?php echo $selectedAnswer ?>
      </p>
      <p class='smiling'>Score:
        <?php echo $score ?>
      </p>
      <p class='smiling'>Num:
        <?php echo $num ?>
      </p>
      <p class='smiling'>Last:
        <?php echo $last ?>
        |
        <?php echo ($_SESSION['finished'])?>
      </p>
      <p class='smiling'>Session score:
        <?php echo ($_SESSION['score'])?>
      </p>
      <p class='smiling'>Student ID:
        <?php echo ($_SESSION['studentID'])?>
      </p>
  </div>
</div>
</body>
</html>